<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<style>
		.active{
			color: red;
		}
	</style>
	<body>
		<script src="../js/vue.js"></script>
		<div id="app">
			
			<h2 class="active">{{message}}</h2>
			<h1 :class="{active:isActive,line:isLine}">{{message}}</h1>
			<h1 :class="getClass()">{{message}}</h1>
			<button @click="btnClick">按钮</button>
		</div>
		<script>
			var app = new Vue({
				el: '#app',
				data: {
					message:"你好啊",
					isActive:true,
					isLine:true,
				},
				methods: {
					btnClick:function(){
						this.isActive=!this.isActive
					},
					getClass:function(){
						return {active:this.isActive,line:this.isLine}
					}
				}
			})
		</script>
	</body>
</html>
